#pragma once

#include <string>
#include <map>
using namespace std;

#include "LogDefine.h"
#include <atlstr.h>

namespace Utility
{
    namespace LoggerLib
    {
        struct LoggingEvent
        {
        public:
            LoggingEvent(const wstring& strMessage, ELOGLEVEL eLevel, unsigned long dwModule);
            ~LoggingEvent(void);

            wstring Format() const;
            wstring FormatWithoutTime() const;
            static wstring GetLevelString(ELOGLEVEL level);

        public:
            wstring message;
            ELOGLEVEL level;
            unsigned long dwModule;
            SYSTEMTIME st;
        };

        // Interface;
        class IExecutor
        {
        protected:
            IExecutor(const wstring& strName);

        public:
            virtual ~IExecutor(void);

        public:
            virtual bool DoLogging(const LoggingEvent& event) = 0;
            virtual bool Reopen() = 0;
            virtual void Close() = 0;

        protected:
            wstring m_strName;
        };
    } // namespace Logger
} // namespace Utility
